package com.cskaoyan.controller.admin;

import com.cskaoyan.bean.BaseData;
import com.cskaoyan.bean.bo.LogParam;
import com.cskaoyan.bean.pojo.MallLog;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.LogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Fengyi
 * @description: 日志文件 用aspectj记录
 * @time: 2021/7/9 20:15
 */
@RestController
public class LogController {

    @Autowired
    LogService logService;

    /**
     * @Author fengyi
     * @description:
     * @Date 20:16 2021/7/9
     * url: http://localhost:8083/admin/log/list
     * ?page=1&limit=20&name=a&sort=add_time&order=desc
     */
    @RequestMapping("admin/log/list")
    @RequiresPermissions("admin:log:list")
    public BaseRespVo logList(LogParam logParam) {

       BaseData<MallLog> mallLogBaseData = logService.queryLog(logParam);
       return BaseRespVo.ok(mallLogBaseData);
    }

}
